# -*- coding: utf-8 -*-
# @Time    : 2024/11/18 10:07
# @Author  : wangwei
# @File    : conftest.py
from typing import List

import pytest as pytest

from common.client import RequestsClient
from common.logger import GetLogger
from testcases.test_ddt_run import test_run


def pytest_collection_modifyitems(
        session: "Session", config: "Config", items: List["Item"]
) -> None:
    # item表示每个测试用例，解决用例名称中文显示问题
    for item in items:
        item.name = item.name.encode("utf-8").decode("unicode-escape")
        item._nodeid = item._nodeid.encode("utf-8").decode("unicode-escape")

@pytest.fixture(scope='session',autouse=True)
def alogger():
    GetLogger.get_logger() # 日志初始化
    RequestsClient.client=RequestsClient()

    
